Robert Collins: 17 Jun 2008
Launchpad, please stop mailing me mine own comments on bugs. I know what I said.
kthxbye
time bzr search socket inet_pton (about 30 hits, first one up in 1 second)... real 0m2.957s user 0m2.768s sys 0m0.180sThe index run takes some time (as you might expect, though like I noted - it hasn't been optimised as such). Once indexed, a branch will be kept up to date automatically on push/pull/commit operations. I realise search is a long slope to get good results on, but hey - I'm not trying to compete with Google :). I wanted something that had the following key characteristics: * Worked when offline * Simple to use * Easy to install Which I've achieved - I'm extremely happy with this plugin. Whats really cool though, is that other developers have picked it up and already integrated it into loggerhead and bzr-eclipse. I don't have a screen shot for loggerhead yet, but heres an old one. This old one does not show the path of a hit, nor the content summaries, which current bzr-search versions create.
#!/usr/bin/env python import linecache import os import os.path import sys def traceit(frame, event, arg): if event == "line": lineno = frame.f_lineno filename = frame.f_globals["__file__"] if (filename.endswith(".pyc") or filename.endswith(".pyo")): filename = filename[:-1] name = frame.f_globals["__name__"] line = linecache.getline(filename, lineno) print "%s:%s: %s" % (name, lineno, line.rstrip()) return traceit def main(): search_path = os.environ.get('PATH', '').split(os.path.pathsep) argv = sys.argv[1:] if not argv: raise Exception("No command to trace supplied") args = argv[1:] command = argv[0] if os.path.sep not in command: for path in search_path: if os.path.exists(os.path.join(path, command)): command = os.path.join(path, command) break del sys.argv[0] source = open(command, 'rt') exec_symbols = dict(globals()) exec_symbols['__name__'] = '__main__' sys.settrace(traceit) exec source in exec_symbols, exec_symbols main()
Next.